<?php include ADMIN_COMMON_PATH.'/header.html';?>
<div class="layui-container fly-marginTop fly-user-main">
    <?php include ADMIN_COMMON_PATH.'/products-nav.html';?>
    <div class="fly-panel fly-panel-user" pad20>
        <div class="layui-tab layui-tab-brief" lay-filter="email">
            <ul class="layui-tab-title" id="LAY_mine">
                <li class="" lay-id="list"><a href="/<?php echo ADMIN_DIR;?>/productscard/">卡密管理</a></li>
                <li class="" lay-id="add"><a href="/<?php echo ADMIN_DIR;?>/productscard/add">添加</a></li>
				<li class="" lay-id="addplus"><a href="/<?php echo ADMIN_DIR;?>/productscard/addplus">批量添加</a></li>
                <li class="layui-this" lay-id="import">导入</li>
				<li class="" lay-id="download"><a href="/<?php echo ADMIN_DIR;?>/productscard/download">导出</a></li>
            </ul>
            <div class="layui-tab-content" style="padding: 20px 0;">
                <div class="layui-form-pane layui-tab-item layui-show">
                    <blockquote class="layui-elem-quote">
                        <p>导入注意事项如下：</p>
                        <p>1.文件类型限制为txt文本文件，大小限制100kb；</p>
                        <p>2.文件内容一行一个，不要使用特殊符号</p>
                    </blockquote>
                    <form class="layui-form layui-show" id="import_table" method="post">
                        <div class="layui-form-item">
                            <label class="layui-form-label">商品分类</label>
                            <div class="layui-input-inline">
                                <select name="typeid" id="typeid" lay-filter="typeid" lay-verify="required">
                                    <option value="0"></option>
                                    <?php if(!empty($products_type)):?>
                                    <?php foreach($products_type AS $type):?>
                                    <option value="<?php echo $type['id'];?>"><?php echo $type['name'];?></option>
                                    <?php endforeach;?>
                                    <?php endif;?>
                                </select>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">商品</label>
                            <div class="layui-input-inline">
                                <select name="pid" id="productlist" lay-filter="productlist" lay-verify="required">
  
                                </select>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <div class="layui-upload-drag" id="import_cards">
                                <i class="layui-icon"></i>
                                <p>点击上传，或将文件拖拽到此处</p>
                            </div>
                        </div>
                        <div class="layui-form-item">
							<input type ="hidden" name ="csrf_token" value="<?php echo $csrf_token;?>">
                            <button class="layui-btn" id="startUpload" key="set-mine" lay-filter="import" lay-submit>确认导入</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<!--引入公共底文件-->
<?php include ADMIN_COMMON_PATH.'/footer.html';?>
<script>
layui.use('adminproductscard');
</script>